﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
		xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
	<Style TargetType="TabItem">
		<Setter Property="Background" Value="#FFF9F9F9" />
		<Setter Property="Padding" Value="10,5" />
		<Setter Property="BorderBrush" Value="#FF8C8E94" />
		<Setter Property="Template">
			<Setter.Value>
				<ControlTemplate TargetType="{x:Type TabItem}">
					<Grid SnapsToDevicePixels="True">
						<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="1,1,1,0"
								Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}">
							<ContentPresenter x:Name="Content" ContentTemplate="{TemplateBinding HeaderTemplate}"
									Content="{TemplateBinding Header}"
									ContentStringFormat="{TemplateBinding HeaderStringFormat}" ContentSource="Header"
									HorizontalAlignment="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ItemsControl}}}"
									RecognizesAccessKey="True"
									SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
									VerticalAlignment="{Binding VerticalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ItemsControl}}}" />
						</Border>
					</Grid>
					<ControlTemplate.Triggers>
						<Trigger Property="IsMouseOver" Value="True">
							<Setter Property="Background" TargetName="Bd" Value="#FFFEFEFE" />
						</Trigger>
						<Trigger Property="IsSelected" Value="True">
							<Setter Property="Panel.ZIndex" Value="1" />
							<Setter Property="Background" TargetName="Bd" Value="{DynamicResource White}" />
						</Trigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsSelected" Value="False" />
								<Condition Property="IsMouseOver" Value="True" />
							</MultiTrigger.Conditions>
							<Setter Property="BorderBrush" TargetName="Bd" Value="#FF3C7FB1" />
						</MultiTrigger>
						<Trigger Property="TabStripPlacement" Value="Bottom">
							<Setter Property="BorderThickness" TargetName="Bd" Value="1,0,1,1" />
						</Trigger>
						<Trigger Property="TabStripPlacement" Value="Left">
							<Setter Property="BorderThickness" TargetName="Bd" Value="1,1,0,1" />
							<Setter Property="LayoutTransform" TargetName="Bd">
								<Setter.Value>
									<RotateTransform Angle="-90" />
								</Setter.Value>
							</Setter>
						</Trigger>
						<Trigger Property="TabStripPlacement" Value="Right">
							<Setter Property="BorderThickness" TargetName="Bd" Value="0,1,1,1" />
							<Setter Property="LayoutTransform" TargetName="Bd">
								<Setter.Value>
									<RotateTransform Angle="90" />
								</Setter.Value>
							</Setter>
						</Trigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsSelected" Value="True" />
								<Condition Property="TabStripPlacement" Value="Top" />
							</MultiTrigger.Conditions>
							<Setter Property="Margin" Value="-2,-2,-2,-1" />
							<Setter Property="Margin" TargetName="Content" Value="0,0,0,1" />
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsSelected" Value="True" />
								<Condition Property="TabStripPlacement" Value="Bottom" />
							</MultiTrigger.Conditions>
							<Setter Property="Margin" Value="-2,-1,-2,-2" />
							<Setter Property="Margin" TargetName="Content" Value="0,1,0,0" />
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsSelected" Value="True" />
								<Condition Property="TabStripPlacement" Value="Left" />
							</MultiTrigger.Conditions>
							<Setter Property="Margin" Value="-2,-2,-1,-2" />
							<Setter Property="Margin" TargetName="Content" Value="0,0,1,0" />
						</MultiTrigger>
						<MultiTrigger>
							<MultiTrigger.Conditions>
								<Condition Property="IsSelected" Value="True" />
								<Condition Property="TabStripPlacement" Value="Right" />
							</MultiTrigger.Conditions>
							<Setter Property="Margin" Value="-1,-2,-2,-2" />
							<Setter Property="Margin" TargetName="Content" Value="1,0,0,0" />
						</MultiTrigger>
						<Trigger Property="IsEnabled" Value="False">
							<Setter Property="Background" TargetName="Bd" Value="#FFF4F4F4" />
							<Setter Property="BorderBrush" TargetName="Bd" Value="#FFC9C7BA" />
							<Setter Property="Foreground"
									Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
						</Trigger>
					</ControlTemplate.Triggers>
				</ControlTemplate>
			</Setter.Value>
		</Setter>
	</Style>
</ResourceDictionary>